import RDFManager.*;
import org.apache.jena.rdf.model.Model;
import org.apache.jena.rdf.model.Property;
import org.apache.jena.rdf.model.ResIterator;
import org.apache.jena.rdf.model.Resource;
import org.apache.jena.vocabulary.RDF;

import java.util.stream.IntStream;

public class temp {


  public static void main(String[] args) {

    Model model = RDFFileReader.readRDFFile();

    String namespace = "http://OAPP/";

    Resource Face = model.getResource(namespace + "Face");
    Resource polygonalPlane = model.getResource(namespace + "polygonalPlane");

    Resource part8 = model.getResource(namespace + "part8");
    Resource part9 = model.getResource(namespace + "part9");
    Resource part10 = model.getResource(namespace + "part10");
    Resource part11 = model.getResource(namespace + "part11");

    Resource part7 = model.getResource(namespace + "part7");
    Resource part12 = model.getResource(namespace + "part12");
    Resource part13 = model.getResource(namespace + "part13");
    Resource part14 = model.getResource(namespace + "part14");


    Property hasFace = model.getProperty(namespace + "hasFace");
    IntStream.range(1, 8).forEach(k -> {
      Resource resource = model.createResource(namespace + "polygonalPlane" + k);
      model.add(resource, RDF.type, Face);
      model.add(resource, RDF.type, polygonalPlane);
      model.add(part8, hasFace, resource);
    });

    IntStream.range(8, 15).forEach(k -> {
      Resource resource = model.createResource(namespace + "polygonalPlane" + k);
      model.add(resource, RDF.type, Face);
      model.add(resource, RDF.type, polygonalPlane);
      model.add(part9, hasFace, resource);
    });

    IntStream.range(15, 22).forEach(k -> {
      Resource resource = model.createResource(namespace + "polygonalPlane" + k);
      model.add(resource, RDF.type, Face);
      model.add(resource, RDF.type, polygonalPlane);
      model.add(part10, hasFace, resource);
    });

    IntStream.range(22, 29).forEach(k -> {
      Resource resource = model.createResource(namespace + "polygonalPlane" + k);
      model.add(resource, RDF.type, Face);
      model.add(resource, RDF.type, polygonalPlane);
      model.add(part11, hasFace, resource);
    });

    IntStream.range(29,36).forEach(k->{
      Resource resource = model.createResource(namespace + "polygonalPlane" + k);
      model.add(resource, RDF.type, Face);
      model.add(resource, RDF.type, polygonalPlane);
      model.add(part7, hasFace, resource);
    });

    IntStream.range(36,43).forEach(k->{
      Resource resource = model.createResource(namespace + "polygonalPlane" + k);
      model.add(resource, RDF.type, Face);
      model.add(resource, RDF.type, polygonalPlane);
      model.add(part12, hasFace, resource);
    });

    IntStream.range(43,50).forEach(k->{
      Resource resource = model.createResource(namespace + "polygonalPlane" + k);
      model.add(resource, RDF.type, Face);
      model.add(resource, RDF.type, polygonalPlane);
      model.add(part13, hasFace, resource);
    });

    IntStream.range(50,57).forEach(k->{

      Resource resource = model.createResource(namespace + "polygonalPlane" + k);
      model.add(resource, RDF.type, Face);
      model.add(resource, RDF.type, polygonalPlane);
      model.add(part14, hasFace, resource);
    });

    RDFOutput.out_turtle(model, "experiment_face_ttl.ttl");
  }

}
